#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
	int t;
	scanf("%d", &t);
	while (t--)
	{
		int n;
		scanf("%d", &n);
		int* arr = (int*)malloc(sizeof(int) * n);
		int max = 0;
		for (int i = 0; i < n; i++)
		{
			scanf("%d", &arr[i]);
			max = (int)fmax(max, max ^ arr[i]);
		}
		printf("%d\n", max);
	}
	return 0;
}